<?php

use yii\db\Schema;
use yii\db\Migration;

class m180207_082714_add_resource_pack_type_and_price_fileds extends Migration
{
    public function up()
    {
        $this->addColumn('{{%resource_pack}}', 'type', 'int(1) not null default 1 comment "1 for app, 2 for wap" after name');
        $this->addColumn('{{%resource_pack}}', 'floor_price', 'decimal(8, 2) not null default 0.01 after type');
        $this->addColumn('{{%resource_pack}}', 'ceiling_price', 'decimal(8, 2) not null default 0.01 after floor_price');
    }

    public function down()
    {
        echo "m180207_082714_add_resource_pack_type_and_price_fileds cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
